<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>hover</title>
    <style>
        .whole{
            width: 840px;
            height: 100px;
            margin: 0 auto;
        }
        .top{
            height: 50px;
        }
        .bottom{
            height: 50px;
            background: yellow;
        }
        .item{
            width: 120px;
            height: 40px;
            margin: 5px 0;
            line-height: 40px;
            text-align: center;
            color: white;
            float: left;
            background: black;
            border-top: 5px solid white;
        }
        .item:hover{
            border-top: 5px solid red;
            background: red;
            border-bottom: 5px solid red;
        }
    </style>
</head>
<body>
<div class="whole">
    <div class="top">
        <div class="item">首页</div>
        <div class="item">国内新闻</div>
        <div class="item">国内新闻</div>
        <div class="item">国内新闻</div>
        <div class="item">国内新闻</div>
        <div class="item">国内新闻</div>
        <div class="item">国内新闻</div>

    </div>
    <div class="bottom"></div>
</div>
</body>
</html>